package cn.tedu.charging.common.pojo.vo;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public  class JsonResult<T> {
    Integer code;
    String message;
    T data;

    public static JsonResult ok(Object data,String msg) {
        JsonResult<Object> result = new JsonResult<>();
        result.setCode(2000);
        result.setData(data);
        result.setMessage(msg);
        return result;
    }
    public static JsonResult ok(Object data) {
        return ok(data,null);
    }
}
